package com.goktech.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.goktech.pojo.Commodity;
import com.goktech.pojo.Image;
import com.goktech.mapper.ImageMapper;
import com.goktech.service.ImageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.goktech.utils.Result;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 商品详情图片表 服务实现类
 * </p>
 *
 * @author 初茶
 * @since 2023-05-14
 */
@Service
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image> implements ImageService {

    @Override
    public Result<List<Image>> goodsImage(Integer id) {
        return Result.ok(baseMapper.selectList(Wrappers.lambdaQuery(Image.class).eq(Image::getCmId, id)));
    }
}
